<div id="page-wrapper">
  <div class="row">
    <div class="col-lg-12">
      <h1>Продукты <small>Список продуктов</small></h1>
      <ol class="breadcrumb">
        <li><a href="<?php echo url::site('admin/products')?>"><i class="icon-dashboard"></i> Продукты</a></li>
      </ol>
      <a href="<?php echo url::site('admin/products/create')?>" class="btn btn-primary btn-lg" type="button">Создать продукт</a>
      <table class="table table-bordered table-hover table-striped tablesorter" style="margin-top: 20px">
        <thead>
        <tr>
          <th>ID <i class="fa fa-sort"></i></th>
          <th>Название <i class="fa fa-sort"></i></th>
          <th>Описание</th>
          <th>Категория</th>
          <th>Опции............. </th>
        </tr>
        </thead>

        <tbody>
        <?php foreach ($products as $product):?>
          <tr class="active">
            <td><?php echo $product->id?></td>
            <td><?php echo $product->title?></td>
            <td><?php echo Text::limit_words($product->description, 20)?></td>
            <td><?php
              $c = ORM::factory('Category', $product->category_id);
              echo $c->title?></td>
            <td> <a href="<?php echo url::site('admin/products/edit/' . $product->id)?>">редак.</a> | <a href="<?php echo url::site('admin/products/delete/' . $product->id)?>">удал.</a></td>
          </tr>
        <?php endforeach?>
        </tbody>
      </table>
    </div>
  </div>
</div>